package controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by yuanlichao on 2017/10/1 0001.
 */
@Controller
public class HelloController {

    @GetMapping("hello")
    public ModelAndView handle(Model model){
        model.addAttribute("message", "Hello World!");
        ModelAndView mv = new ModelAndView();
        mv.setViewName("index");
        return mv;
    }
}
